//引入封装的reuest请求
const {
  request
} = require('./request')
module.exports = {
  // 参数详解
  // login: (code) =>{     请求名
  // 	return request(
  // 		"user/login",      请求地址
  // 		"GET",             请求方式 
  // 		code,              请求参数
  // 		false,             是否添加二级子域名
  //    true               加载状态
  //    true               是否携带token
  // 	)
  // },


     /**
     *  用户登录
     */ 
    apiUserlogin: (data) =>{return request("wxapi/user/userlogin","GET",data,false,true,false)},

    /**
     * 更新用户信息
     */
    apiUpdateUserInfo: (data) =>{return request("user/updateUserInfo","POST",data,true)},
  /**
   * 全局搜索
   */ 
  apiGetSchoolAndCommentList: (data) =>{return request("commonWeb/getSearchList","POST",data,false)},

  /**
   * 字典
   * 
  */
  // 获取字典
  apiGetDictList: (data) =>{return request("commonData/findDictionaryPublic","GET",data,false)},

  /**
   * 用户信息
   * 
   * */ 

   //大学查询接口
   apiGetBizSchoolsPublic :(data) =>{return request("schools/list","GET",data,false)},
     //大学详情页接口
     apiGetBizSchoolsInfoPublic :(data) =>{return request("schools/getSchoolsIndex","GET",data,false)},
   // 查询专业列表接口
apiGetProfessionsBySearch: (data) => {
  return request("schools/searchProfessions", "GET",data, false)
},
//根据学校地区，开学时间，培养计划获取详细信息
  apiGetProfessionsBySchool: (data) => {
  return request("schools/getSchoolsList", "GET", data, false)
},
//根据学校地区获取培养计划
  apiGetEduPlanByArea: (data) => {
    return request(`schools/getEduPlanIdByPlaceId/${data.placeId}`, "GET", {}, false)
  },
    //字典查询接口
    apiGetDicPublic :(data) =>{
      return request("dicData/getDicData","GET",data,false)
    },
    //我的收藏查询接口
    apiGetMyCollectPublic :(data) =>{
      return request("userstars/selectUserStarsListByUserIdAndEduPlanId","GET",data,true)
    },
    //我的收藏删除接口（restful风格，id拼接到url路径）
    apiDeleteMyCollectPublic: (data) => {
      return request(`userstars/remove/${data.id}`, "DELETE", {}, true);
    },
     //计数未读信息查询接口
     apiGetUnreadCountPublic: (data) => {
      return request("usernotify/countNotReadNotify", "GET", data, true);
    },
     //评论查询接口
     apiGetCommentPublic: (data) => {
      return request("usercomments/selectCommentsListByUserId", "GET", data, true);
    },
    //消息列表查询接口
    apiGetMessageListPublic: (data) => {
      return request("usernotify/selectNotifyList", "GET", data, true);
    },
    //消息删除接口（restful风格，id拼接到url路径）
    apiDeleteMessagePublic: (data) => {
      return request(`usernotify/remove/${data.id}`, "DELETE", {}, true);
    },
    //消息已读接口（restful风格，id拼接到url路径）
    apiReadMessagePublic: (data) => {
      return request(`usernotify/read/${data.id}`, "PUT", {}, true);
    },
    //发布评论
    apiPublishComment: (data) => {
      return request(`usercomments/publishComment`, "POST", data, true);
    },
    //获取评论
    apiSelectCommentsBySchoolId: (data) => {
      return request("usercomments/selectCommentsBySchoolId", "GET", data, false);
    },
    //获取评论详情
    apigetCommentById: (data) => {
      return request("usercomments/getCommentsById", "GET", data, true);
    },
    //查询评论
    apiSelectReplys: (data) => {
      return request("usercomments/selectReplys", "GET", data, true);
    },
    //删除评论
    deleteComment: (data) => {
      return request("usercomments/deleteComment", "GET", data, true);
    },
     //点赞评论
     likeComment: (data) => {
      return request("usercomments/likeComment", "GET", data, true);
    },
    //收藏院校
    addUserStars: (data) => {
      return request("userstars/addUserStars", "GET", data, true);
    },
    //查询专业详细信息
    getProfession: (data) => {
      // 需要传id和schoolId
      return request(`userprofession/getProfession/${data.id}/${data.schoolId}`, "GET", {}, false);
    },
     //获取字典信息
     getAllDicData: (data) => {
      return request("dicData/getAllDicData", "GET", data, false);
    },

    //获取专业列表
    apiGetProfessionList: (data) => {
      return request("userprofession/getProfessionList", "GET", data, true);
    },
    //获取专业列表
    apiGetDepartmentBySchoolId: (data) => {
      return request("schools/getDepartmentBySchoolId", "GET", data, true);
    },
    //获取院校详情
    apiGetSchoolInfo: (data) => {
      return request("schools/getSchoolInfo", "GET", data, false);
    },
  // 新增预约信息接口
  apiAddReseve: (data) => {
    return request("reserve/add", "POST", data, true);
  },
  // 其他接口...
    
}
